Skip to content

Release 26.3.2.1 - CPAP/Tank Refill Mode, new sensors, and ESPHome modernization#35

Open
bharvey88 wants to merge 36 commits into
mainfrom
beta
Open

Release 26.3.2.1 - CPAP/Tank Refill Mode, new sensors, and ESPHome modernization#35
bharvey88 wants to merge 36 commits into
mainfrom
beta

Conversation

@bharvey88

@bharvey88 bharvey88 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Version: 26.3.2.1

What does this implement/fix?

Merges beta into main for the 26.3.2.1 release. Changes include:

  • Tank Refill Mode (formerly Invert Water Logic) — flips input sensor meaning so DRY = destination low = start pump, WET = destination full = stop pump; auto-configures related switches on toggle and on boot restore
  • Auto Refill — automatically triggers pumpUntilFull when input sensor goes dry in Tank Refill Mode; auto-toggles with Tank Refill Mode
  • Last Pump Action text sensor — surfaces pump events (Auto Refill Triggered, Pump Started, Pump Stopped) as readable entries in the HA logbook
  • ESPHome modernisation — web server v3, remove redundant board string (variant + flash_size already present), remove legacy platformio options and BLE wifi hooks (breaking: board spec change)
  • IP address text sensor — via wifi_info platform
  • ESPHome version + Apollo firmware version text sensors
  • Bug fixes — Apollo firmware version showing "unknown", auto refill triggering on boot, premature pump stop in inverted mode with two sensors, pump_stopped logbook entries on rejected starts

Types of changes

  • Bugfix (fixed change that fixes an issue)
  • New feature (thanks!)
  • Breaking change (repair/feature that breaks existing functionality)
  • Dependency Update - Does not publish
  • Other - Does not publish
  • Website of github readme file update - Does not publish
  • Github workflows - Does not publish

Checklist / Checklijst:

  • The code change has been tested and works locally
  • The code change has not yet been tested

If user-visible functionality or configuration variables are added/modified:

  • Added/updated documentation for the web page

Summary by CodeRabbit

  • New Features

    • Added tank refill mode and auto-refill switches for customizable pump control
    • Added device diagnostics display including firmware version, IP address, and pump action history
  • Updates

    • Updated to a newer ESPHome version with improved web server capabilities

bharvey88 and others added 30 commits February 24, 2026 18:43
…ions

- Remove redundant esp32 board string (variant + flash_size already present)
- Add web_server version: 3 to Core.yaml
- Remove platformio_options board_build.flash_mode from both device YAMLs
- Remove legacy BLE wifi on_connect/on_disconnect hooks from PUMP-1.yaml
[esphome] Modernise board spec, web server v3, remove legacy options
[version] Add ESPHome and Apollo firmware version sensors
Adds two new optional config switches (off by default):
- Invert Water Logic: flips input sensor meaning so DRY = destination low = start pump, WET = destination full = stop pump
- Auto Refill: automatically triggers pumpUntilFull when input sensor goes dry in inverted mode

Resolves #22
When stop_pump_when_full is ON, the output sensor already handles full
detection. Skip the inverted-mode input sensor stop to prevent the pump
from stopping as water passes the low-level sensor on the way to full.
Bump version to 26.3.2.1
[cpap] Add invert water logic and auto refill for CPAP filling use case
The sensor was showing "unknown" because update_interval: never prevents
the lambda from ever firing. Removing it allows the default 60s periodic
update to publish the version string.
Fix Apollo Firmware Version sensor showing unknown
Per ESPHome dev feedback: the version is a compile-time constant, so
publish it once on_boot rather than using a lambda with periodic updates.
Add text_sensor.template.publish for apollo_firmware_version at
priority 500 to PUMP-1_Minimal for dashboard import users.
Fix: publish firmware version once on boot instead of polling
Adds a homeassistant.action logbook.log call in the fluid_input_sensor
on_release handler so that HA logbook records when the pump is triggered
automatically by the CPAP auto refill + invert water logic mode.
[cpap] Add logbook entry for auto refill trigger
Replaces the homeassistant.action logbook.log approach from #32 with an
ESPHome event entity, which surfaces natively in the HA logbook without
requiring API actions to be enabled on the device.

Fires three event types:
- auto_refill_triggered: CPAP auto refill + invert water logic triggers pump
- pump_started: pump_control turns on and conditions are met
- pump_stopped: pump_control turns off
pump_start_time is only set when the pump actually starts successfully.
Checking != 0 before logging and emitting pump_stopped prevents false
logbook entries when a start is rejected and switch.turn_off is called
from the else branch of on_turn_on.
…tries

ESPHome event entities show only a generic 'detected an event' string in
the HA logbook. Replaces the Pump Activity event entity with a Last Pump
Action text sensor whose state changes (Auto Refill Triggered, Pump
Started, Pump Stopped) appear verbatim in the HA logbook.
[cpap] Add Last Pump Action text sensor for HA logbook
…switches

Renames the switch name, id, and all 4 condition references from
invert_water_logic to tank_refill_mode for clarity.

Adds on_turn_on/on_turn_off handlers to auto-configure related switches:
- Turn ON: Stop Pump When Output Wet → ON, Stop Pump When Input Dry → OFF
- Turn OFF: Stop Pump When Output Wet → OFF, Stop Pump When Input Dry → ON
…de state

on_turn_on/on_turn_off only fire when explicitly toggled, not on boot
restore. Adds a priority -20 on_boot handler that reads tank_refill_mode
and sets stop_pump_when_full and stop_pump_when_dry accordingly so all
three switches are in sync after every reboot.
…witches

[ux] Rename Invert Water Logic to Tank Refill Mode + auto-configure switches
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TrevorSchirmer, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb8cc0eb-fa8a-4672-936d-51e459895cd7

📥 Commits

Reviewing files that changed from the base of the PR and between 640f627 and 1cf2bfa.

📒 Files selected for processing (3)
  • .github/workflows/autoassign.yml
  • .github/workflows/ci.yml
  • .github/workflows/label-check.yml

Walkthrough

This PR introduces a refill mode feature to the ESPHome pump controller, enabling inverted pump logic with auto-refill automation. Core.yaml is significantly enhanced with new switches, pump control refactoring, auto-refill triggering, and safety enhancements. Device configs are updated to publish firmware versions at boot, and release drafter formatting is simplified.

Changes

ESPHome Refill Mode and Pump Control

Layer / File(s) Summary
Refill-Mode Switches and Boot Initialization
Integrations/ESPHome/Core.yaml
Added tank_refill_mode and auto_refill template switches with on_turn_on/on_turn_off actions controlling stop_pump_when_full, stop_pump_when_dry, and auto_refill state. Boot automation (priority -20) initializes these switches at startup.
Pump Control and Auto-Refill Automation
Integrations/ESPHome/Core.yaml
Reworked pump_control on_turn_on logic to implement refill-mode start gating and publish last_pump_action ("Pump Started"). Updated on_turn_off to conditionally publish "Pump Stopped" when pump had non-zero start time. Added fluid_input_sensor on_release automation that triggers pumpUntilFull when auto_refill and tank_refill_mode are enabled and pump is off.
Safety Checks and Diagnostic Sensors
Integrations/ESPHome/Core.yaml
Enhanced pump_safety_check script with refill-mode safety branches for destination-full detection in inverted mode. Added text_sensor definitions for last_pump_action, wifi_ip, ESPHome version, and apollo_firmware_version diagnostic sensors.
Version Management and Device Boot/Update Flows
Integrations/ESPHome/Core.yaml, Integrations/ESPHome/PUMP-1.yaml, Integrations/ESPHome/PUMP-1_Minimal.yaml
Updated ESPHome version from 25.12.18.1 to 26.3.2.1 and configured web_server to use version 3. Added on_boot automation (priority 500) in PUMP-1.yaml and PUMP-1_Minimal.yaml to publish apollo_firmware_version at startup. Modified WiFi on_connect in PUMP-1.yaml to trigger firmware_update component.update directly.

Release Notes Configuration

Layer / File(s) Summary
Release Drafter Template Updates
.github/release-drafter.yml
Added category-template: '**$TITLE**' to format category titles in bold. Modified release body template to use bold "What's Changed" header without markdown heading syntax, added comments about changelog link handling, and removed embedded full changelog URL and repository star prompt.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • ApolloAutomation/PUMP-1#34: Renames invert_water_logic to tank_refill_mode with associated propagation through refill switches and pump/safety logic.
  • ApolloAutomation/PUMP-1#28: Implements auto-refill behavior and inverted pump logic using an invert_water_logic boolean switch with similar pump start/stop and fluid sensor rework.
  • ApolloAutomation/PUMP-1#33: Adds the last_pump_action text sensor with "Pump Started/Stopped" and "Auto Refill Triggered" publishing from pump control and fluid sensor paths.

Suggested labels

bugfix

Suggested reviewers

  • TrevorSchirmer

Poem

🐰 A fluffy rabbit hops with glee,
For refill modes now flow so free,
Auto-pumping when tanks run dry,
Safety checks stand ever nigh,
Firmware versions in the boot,
A hoppy feature, absolute!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and comprehensively summarizes the main changes: version bump to 26.3.2.1, Tank Refill Mode feature, new sensors, and ESPHome modernization—all directly supported by the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch beta

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the breaking-change Breaking change label Mar 27, 2026
@bharvey88 bharvey88 changed the title Release 26.3.2.1 - CPAP/Tank Refill Mode, new sensors, and ESPHome modernisation Release 26.3.2.1 - CPAP/Tank Refill Mode, new sensors, and ESPHome modernization Apr 12, 2026
@bharvey88 bharvey88 added the new-feature New feature label Apr 12, 2026
@languy99

Copy link
Copy Markdown

how can i get a copy of this firmware to try out on my pump?

@bharvey88

Copy link
Copy Markdown
Contributor Author

how can i get a copy of this firmware to try out on my pump?

Thanks for your interest in our beta branch! Please follow this tutorial to get on the beta branch! https://wiki.apolloautomation.com/products/general/setup/switch-to-beta-branch/

@languy99

Copy link
Copy Markdown

This there a way to install without home assistant? I actually use Hubitat and wrote a driver for the pump there. I got it running just fine but would like to try the beta software.

@bharvey88

bharvey88 commented May 25, 2026

Copy link
Copy Markdown
Contributor Author

This there a way to install without home assistant? I actually use Hubitat and wrote a driver for the pump there. I got it running just fine but would like to try the beta software.

You can follow the steps from our new unreleased product here to test the esphome device builder app in windows, macos, etc

https://wiki.apolloautomation.com/products/ESPHome-Starter-Kit/setup/first-steps/#esphome-device-builder

I do not have step by step instructions at this time because it's an experimental beta app by the ESPHome project and still changing.

Regarding Hubitat driver for pump-1, can you please share what you have done for this and how to duplicate it for others?

We have a user who has beta drivers for some of our devices here: https://community.hubitat.com/t/beta-apollo-automation-air-1-driver/155982

@languy99

Copy link
Copy Markdown

This there a way to install without home assistant? I actually use Hubitat and wrote a driver for the pump there. I got it running just fine but would like to try the beta software.

You can follow the steps from our new unreleased product here to test the esphome device builder app in windows, macos, etc

https://wiki.apolloautomation.com/products/ESPHome-Starter-Kit/setup/first-steps/#esphome-device-builder

I do not have step by step instructions at this time because it's an experimental beta app by the ESPHome project and still changing.

Regarding Hubitat driver for pump-1, can you please share what you have done for this and how to duplicate it for others?

We have a user who has beta drivers for some of our devices here: https://community.hubitat.com/t/beta-apollo-automation-air-1-driver/155982

Thanks I’ll check this out. As for the pump-1 driver I dropped the raw code in a reply in the thread. That way anyone can use it as they see fit.

bharvey88 and others added 4 commits June 10, 2026 16:00
Fork-submitted PRs get a read-only token on pull_request runs, so the
label and assignee bots fail with 403. pull_request_target runs in the
base repo context with a write token; safe here because neither job
checks out or executes PR code. Build jobs stay on pull_request. Trim
ci.yml permissions to what the builds need.
The http_request update component polls every 6h and the first poll
fires before the network is up, so a freshly booted device does not
see an available update for up to 6 hours. Trigger a manifest check
as soon as the network connects.
Home Assistant shows only the first 255 characters of an ESPHome
release summary, so boilerplate is expensive and ## headings render
oversized in the update dialog:

- Render category titles and What's Changed in bold instead of H2
- Drop the star-the-repo footer
- Drop the Full Changelog line: it semver-truncates 4-part versions
  (always links ...X.Y.Z.1) - the shared build workflow now appends
  a correct compare link instead
Fix firmware update entity being stale for 6h after boot

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Integrations/ESPHome/Core.yaml`:
- Around line 186-197: The bypass branch in pump_control → on_turn_on currently
allows pump start solely when switch.stop_pump_when_dry is off, which becomes
true whenever tank_refill_mode is enabled; modify that branch so the bypass
requires both stop_pump_when_dry to be off AND tank_refill_mode to be off (i.e.,
only allow the dry-protection bypass when tank_refill_mode is not active),
updating the or: branch that contains "- switch.is_off: stop_pump_when_dry" to
include an additional condition referencing "switch.is_off: tank_refill_mode".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1d44723-1376-44b3-a31a-426f1653c747

📥 Commits

Reviewing files that changed from the base of the PR and between b280add and 640f627.

📒 Files selected for processing (4)
  • .github/release-drafter.yml
  • Integrations/ESPHome/Core.yaml
  • Integrations/ESPHome/PUMP-1.yaml
  • Integrations/ESPHome/PUMP-1_Minimal.yaml

Comment on lines +26 to +31
- switch.turn_on: stop_pump_when_full
- switch.turn_off: stop_pump_when_dry
- switch.turn_on: auto_refill
else:
- switch.turn_off: stop_pump_when_full
- switch.turn_on: stop_pump_when_dry

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="Integrations/ESPHome/Core.yaml"

# Show the exact snippet around the initially referenced lines (26-31)
echo "=== $FILE lines 1-80 ==="
nl -ba "$FILE" | sed -n '1,80p'

# Show the section around the other referenced range (152-200)
echo
echo "=== $FILE lines 120-200 ==="
nl -ba "$FILE" | sed -n '120,210p'

# Show the section around the referenced branch near 458-520
echo
echo "=== $FILE lines 430-520 ==="
nl -ba "$FILE" | sed -n '430,520p'

# Find all occurrences of stop_pump_when_full and show small context
echo
echo "=== Occurrences of stop_pump_when_full ==="
rg -n "stop_pump_when_full" "$FILE" || true

# For each is_off/is_on condition involving stop_pump_when_full, show a bit more context
echo
echo "=== Lines with switch.is_off/on: stop_pump_when_full ==="
rg -n "switch\.(is_off|is_on):\s*stop_pump_when_full" "$FILE" -n || true

# Show definition/booleans for stop_pump_when_full if present
echo
echo "=== Potential stop_pump_when_full entity definition (context) ==="
rg -n "(id:\s*stop_pump_when_full|name:\s*stop_pump_when_full|platform:|binary_sensor:|switch:)" "$FILE" || true

Repository: ApolloAutomation/PUMP-1

Length of output: 178


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="Integrations/ESPHome/Core.yaml"
if [ ! -f "$FILE" ]; then
  echo "Missing file: $FILE"
  exit 1
fi

show_range () {
  local start="$1" end="$2"
  echo "=== $FILE lines $start-$end ==="
  awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {printf "%6d %s\n", NR, $0}' "$FILE"
  echo
}

show_range 1 80
show_range 120 210
show_range 430 520

echo "=== Occurrences of stop_pump_when_full ==="
rg -n "stop_pump_when_full" "$FILE" || true
echo
echo "=== Lines with switch.is_off/is_on: stop_pump_when_full ==="
rg -n "switch\.(is_off|is_on):\s*stop_pump_when_full" "$FILE" || true
echo
echo "=== Potential stop_pump_when_full entity definition (context) ==="
rg -n "(id:\s*stop_pump_when_full|name:\s*stop_pump_when_full)" "$FILE" || true

Repository: ApolloAutomation/PUMP-1

Length of output: 9824


🏁 Script executed:

#!/bin/bash
set -euo pipefail
FILE="Integrations/ESPHome/Core.yaml"

for term in "fluid_input_sensor" "fulid_output_sensor" "inverted" "destination full" "refill" "auto_refill" "pumpUntilFull" "pump_control" "fulid_output_sensor"; do
  echo "=== rg $term ==="
  rg -n "$term" "$FILE" || true
done

echo
echo "=== Show sensor-related sections (small ranges) ==="
# show a few nearby ranges around likely sensor ids
rg -n "binary_sensor:" "$FILE"
# print around first few matches of fluid_input_sensor
for l in $(rg -n "fluid_input_sensor" "$FILE" | cut -d: -f1 | head -n 5); do
  start=$((l-15)); end=$((l+40));
  echo "--- around line $l ($start-$end) ---"
  awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {printf "%6d %s\n", NR, $0}' "$FILE"
  echo
done

# print around fulid_output_sensor occurrences
for l in $(rg -n "fulid_output_sensor" "$FILE" | cut -d: -f1 | head -n 5); do
  start=$((l-15)); end=$((l+40));
  echo "--- around line $l ($start-$end) ---"
  awk -v s="$start" -v e="$end" 'NR>=s && NR<=e {printf "%6d %s\n", NR, $0}' "$FILE"
  echo
done

Repository: ApolloAutomation/PUMP-1

Length of output: 17605


🏁 Script executed:

#!/bin/bash
set -euo pipefail
FILE="Integrations/ESPHome/Core.yaml"

echo "=== Context around additional stop_pump_when_full usage (~370-420) ==="
awk 'NR>=350 && NR<=430 {printf "%6d %s\n", NR, $0}' "$FILE"

echo
echo "=== Exact tank_full vs destination_full conditions in pump_safety_check (~430-475) ==="
awk 'NR>=430 && NR<=477 {printf "%6d %s\n", NR, $0}' "$FILE"

Repository: ApolloAutomation/PUMP-1

Length of output: 5355


Inverted-mode “destination full” stop is gated on stop_pump_when_full: off, but refill mode turns stop_pump_when_full on by default—making that stop path unreachable unless the switch is manually disabled.

  • tank_refill_mode enables stop_pump_when_full (on_boot: lines 26-31; on_turn_on: lines 150-154; pumpUntilFull: lines 388-393).
  • In pump_safety_check, the inverted-mode “destination full” block requires tank_refill_mode and switch.is_off: stop_pump_when_full (lines 458-466), so it won’t run in default refill mode; only the separate “tank full” check (output sensor, gated on stop_pump_when_full: on) can stop the pump.
One possible alignment
-                      - switch.is_off: stop_pump_when_full
+                      - switch.is_on: stop_pump_when_full

Comment on lines 186 to 197
or:
- binary_sensor.is_on: fluid_input_sensor
# Normal mode: input has water
- and:
- switch.is_off: tank_refill_mode
- binary_sensor.is_on: fluid_input_sensor
# Inverted mode: input is dry (destination is low, needs filling)
- and:
- switch.is_on: tank_refill_mode
- binary_sensor.is_off: fluid_input_sensor
# Bypass: dry protection not enabled
- switch.is_off: stop_pump_when_dry
then:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="Integrations/ESPHome/Core.yaml"

echo "== Target file existence =="
ls -la "$FILE" || true

echo
echo "== Lines 150-230 =="
nl -ba "$FILE" | sed -n '140,240p'

echo
echo "== Find tank_refill_mode usages/definitions =="
rg -n "tank_refill_mode" "$FILE" || true

echo
echo "== Find stop_pump_when_dry usages/definitions =="
rg -n "stop_pump_when_dry" "$FILE" || true

echo
echo "== Show relevant start gating context (look for 'start'/'pump' 'dry' logic blocks) =="
rg -n -C 2 "(start|pump).*dry|dry.*(start|pump)|(tank_refill_mode|stop_pump_when_dry).*then:|on_press|on_boot|lambda|id:|condition:|or:|switch\.is_off|switch\.is_on" "$FILE" || true

Repository: ApolloAutomation/PUMP-1

Length of output: 259


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="Integrations/ESPHome/Core.yaml"

echo "== Lines 150-230 =="
awk 'NR>=150 && NR<=230 {printf "%d\t%s\n", NR, $0}' "$FILE"

echo
echo "== Find tank_refill_mode usages/definitions =="
rg -n "tank_refill_mode" "$FILE" || true

echo
echo "== Find stop_pump_when_dry usages/definitions =="
rg -n "stop_pump_when_dry" "$FILE" || true

echo
echo "== Context around OR branch near lines ~180-200 =="
awk 'NR>=170 && NR<=210 {printf "%d\t%s\n", NR, $0}' "$FILE"

echo
echo "== Find the 'pump start' gating logic block (best-effort search) =="
rg -n -C 3 "(pump|start).*condition:|condition:|or:|binary_sensor\.is_(on|off)|switch\.is_(on|off)" "$FILE" | head -n 200

Repository: ApolloAutomation/PUMP-1

Length of output: 10325


Tank Refill Mode should not satisfy the “dry protection bypass” branch for pump start

In pump_controlon_turn_on, pump start is allowed when any or: branch is true, including - switch.is_off: stop_pump_when_dry. But when tank_refill_mode is enabled, stop_pump_when_dry is forced OFF, so this bypass branch becomes true and lets the pump start even when fluid_input_sensor indicates wet.

Suggested fix
-                # Bypass: dry protection not enabled
-                - switch.is_off: stop_pump_when_dry
+                # Bypass only in normal mode when dry protection is intentionally disabled
+                - and:
+                    - switch.is_off: tank_refill_mode
+                    - switch.is_off: stop_pump_when_dry
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
or:
- binary_sensor.is_on: fluid_input_sensor
# Normal mode: input has water
- and:
- switch.is_off: tank_refill_mode
- binary_sensor.is_on: fluid_input_sensor
# Inverted mode: input is dry (destination is low, needs filling)
- and:
- switch.is_on: tank_refill_mode
- binary_sensor.is_off: fluid_input_sensor
# Bypass: dry protection not enabled
- switch.is_off: stop_pump_when_dry
then:
or:
# Normal mode: input has water
- and:
- switch.is_off: tank_refill_mode
- binary_sensor.is_on: fluid_input_sensor
# Inverted mode: input is dry (destination is low, needs filling)
- and:
- switch.is_on: tank_refill_mode
- binary_sensor.is_off: fluid_input_sensor
# Bypass only in normal mode when dry protection is intentionally disabled
- and:
- switch.is_off: tank_refill_mode
- switch.is_off: stop_pump_when_dry
then:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Integrations/ESPHome/Core.yaml` around lines 186 - 197, The bypass branch in
pump_control → on_turn_on currently allows pump start solely when
switch.stop_pump_when_dry is off, which becomes true whenever tank_refill_mode
is enabled; modify that branch so the bypass requires both stop_pump_when_dry to
be off AND tank_refill_mode to be off (i.e., only allow the dry-protection
bypass when tank_refill_mode is not active), updating the or: branch that
contains "- switch.is_off: stop_pump_when_dry" to include an additional
condition referencing "switch.is_off: tank_refill_mode".

Fix label-check and auto-assign on fork PRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Breaking change new-feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants